home *** CD-ROM | disk | FTP | other *** search
/ IRIX Base Documentation 2002 November / SGI IRIX Base Documentation 2002 November.iso / usr / share / catman / p_man / cat3 / f90 / pxfwait.z / pxfwait
Encoding:
Text File  |  2002-10-03  |  7.0 KB  |  158 lines

  1. PXFWAIT(3F)                                           Last changed: 1-22-99
  2.  
  3.  
  4. NNAAMMEE
  5.      PPXXFFWWAAIITT, PPXXFFWWAAIITTPPIIDD - Obtains information about a calling process'
  6.      child process
  7.  
  8. SSYYNNOOPPSSIISS
  9.      SSUUBBRROOUUTTIINNEE PPXXFFWWAAIITT ((_i_s_t_a_t,, _i_r_e_t_p_i_d,, _i_e_r_r_o_r))
  10.      IINNTTEEGGEERR _i_s_t_a_t,, _i_r_e_t_p_i_d,, _i_e_r_r_o_r
  11.  
  12.      SSUUBBRROOUUTTIINNEE PPXXFFWWAAIITTPPIIDD ((_i_p_i_d,, _i_s_t_a_t,, _i_o_p_t_i_o_n_s,, _i_r_e_t_p_i_d,, _i_e_r_r_o_r))
  13.      IINNTTEEGGEERR _i_p_i_d,, _i_s_t_a_t,, _i_o_p_t_i_o_n_s,, _i_r_e_t_p_i_d,, _i_e_r_r_o_r
  14.  
  15. IIMMPPLLEEMMEENNTTAATTIIOONN
  16.      UNICOS, UNICOS/mk, and IRIX systems
  17.  
  18. DDEESSCCRRIIPPTTIIOONN
  19.      On IRIX systems, this routine is in lliibbffoorrttrraann..ssoo which is linked by
  20.      default when compiling programs with the MIPSpro 7 Fortran 90 compiler
  21.      or when compiling programs with the --ccrraayylliibbss option to the MIPSpro
  22.      F77 compiler.
  23.  
  24.      The PPXXFFWWAAIITT routine uses the wwaaiitt(2) system call to obtain information
  25.      about one of the calling process's child processes.
  26.  
  27.      The PPXXFFWWAAIITTPPIIDD routine uses the wwaaiittppiidd(2) system call to obtain
  28.      information about one of the calling process's child processes.
  29.  
  30.      When using the CF90 compiler or MIPSpro 7 Fortran 90 compiler on
  31.      UNICOS, UNICOS/mk, or IRIX systems, all arguments must be of default
  32.      kind unless documented otherwise.  On UNICOS and UNICOS/mk, default
  33.      kind is KKIINNDD==88 for integer, real, complex, and logical arguments; on
  34.      IRIX, the default kind is KKIINNDD==44.
  35.  
  36.      The following is a list of arguments for this routine:
  37.  
  38.      _i_p_i_d      An input integer variable containing the child process ID
  39.                for which information is requested.
  40.  
  41.                * If _i_p_i_d is equal to -1, status is requested for any child
  42.                  process; PPXXFFWWAAIITTPPIIDD is then equivalent to PPXXFFWWAAIITT.
  43.  
  44.                * If _i_p_i_d is greater than 0, it specifies the process ID of
  45.                  a single child process for which status is requested.
  46.  
  47.                * If _i_p_i_d is equal to 0, status is requested for any child
  48.                  process with a process group ID that is equal to that of
  49.                  the calling process.
  50.  
  51.                * If _i_p_i_d is less than -1, status is requested for any child
  52.                  process with a process group ID that is equal to the
  53.                  absolute value of _i_p_i_d.
  54.  
  55.      _i_s_t_a_t     An output integer variable for the status information.
  56.  
  57.      _i_o_p_t_i_o_n_s  An input integer variable constructed from an inclusive OORR
  58.                of zero or more of the following options:
  59.  
  60.                WWNNOOHHAANNGG     The wwaaiittppiidd system call does not suspend
  61.                            execution of the calling process if status is
  62.                            not immediately available for one of the calling
  63.                            processes specified by pid.
  64.  
  65.                WWUUNNTTRRAACCEEDD   If job control is supported, the status of any
  66.                            child processes specified by pid that are
  67.                            stopped, and with a status that has not yet been
  68.                            reported since they stopped, are also reported
  69.                            to the requesting process.
  70.  
  71.                UNICOS and UNICOS/mk systems only:
  72.  
  73.                WWMMTTWWAAIITT     Waits for the children of any member of the
  74.                            multitasking group.  In UNICOS 9.0 this is the
  75.                            default behavior for both wwaaiitt and wwaaiittppiidd.  The
  76.                            flag is still provided for source compatibility.
  77.                            To get the previous behavior, see the
  78.                            description of the WWLLWWPPWWAAIITT flag.
  79.  
  80.                WWLLWWPPWWAAIITT    Waits only for the immediate children of the
  81.                            calling light-weight process (LWP).  This flag
  82.                            is not recommended for general use.
  83.  
  84.      _i_r_e_t_p_i_d   An output integer variable for the child process ID.
  85.  
  86.      _i_e_r_r_o_r    An output integer variable that contains zero if the routine
  87.                was successful or nonzero if the routine was not successful.
  88.  
  89.      Any of the following error values may be returned:
  90.  
  91.      EECCHHIILLDD    PPXXFFWWAAIITT: If the calling process has no existing unwaited-for
  92.                child processes.
  93.                PPXXFFWWAAIITTPPIIDD:  The process or process group specified by _i_p_i_d
  94.                does not exist or is not a child of the calling process.
  95.  
  96.      EEIINNTTRR     If receipt of a signal other than the death-of-a-child-
  97.                process signal.
  98.  
  99.      EEIINNVVAALL    The value of the _i_o_p_t_i_o_n_s argument is not valid.
  100.  
  101. EEXXAAMMPPLLEESS
  102.    PPXXFFWWAAIITT eexxaammppllee::
  103.           program pxftest
  104.           integer istat, iretpid, ipid, ierror, i, j
  105.  
  106.           CALL PXFFORK(ipid,ierror)
  107.           if (ierror .ne. 0) then
  108.               print *,'FAILED: PXFFORK call failed with error = ',ierror
  109.           else
  110.               if (ipid .eq. 0) then
  111.                  j = 0
  112.                  do i=1,100000
  113.                     j = j + i
  114.                  enddo
  115.                  stop
  116.               else
  117.                  CALL PXFWAIT(istat,iretpid,ierror)
  118.                  if (ierror .eq. 0) then
  119.                      print *,'PASSED: PXFWAIT normal test'
  120.                  else
  121.                      print *,'FAILED: PXFWAIT call with error = ',ierror
  122.                  endif
  123.               endif
  124.           endif
  125.           end
  126.  
  127.    PPXXFFWWAAIITTPPIIDD eexxaammppllee::
  128.           program pxftest
  129.           integer istat, iretpid, ipid, ierror, i, j, ioptions
  130.  
  131.           CALL PXFFORK(ipid,ierror)
  132.           if (ierror .ne. 0) then
  133.              print *,'FAILED: PXFFORK call failed with error = ',ierror
  134.           else
  135.              if (ipid .eq. 0) then
  136.                 j = 0
  137.                 do i=1,100000
  138.                    j = j + i
  139.                 enddo
  140.                 stop
  141.              else
  142.                 ioptions = 0
  143.                 CALL PXFWAITPID(ipid,istat,ioptions,iretpid,ierror)
  144.                 if (ierror .eq. 0) then
  145.                    print *,'PASSED: PXFWAITPID normal test'
  146.                 else
  147.                    print *,'FAILED: PXFWAITPID call with error = ',ierror
  148.                 endif
  149.              endif
  150.           endif
  151.           end
  152.  
  153. SSEEEE AALLSSOO
  154.      wwaaiitt(2), wwaaiittppiidd(2)
  155.  
  156.      _A_p_p_l_i_c_a_t_i_o_n _P_r_o_g_r_a_m_m_e_r'_s _L_i_b_r_a_r_y _R_e_f_e_r_e_n_c_e _M_a_n_u_a_l for the printed
  157.      version of this man page.
  158.